#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <vector>
#define int long long
#define x first
#define y second
using namespace std;
const int N = 1e2 + 10;
int len;
string str[N];
void solve()
{
	int n;
	cin >> n;
	// vector<string> str(n+1);
	for (int i = 1; i <= n; i++)
	{
		cin >> str[i];
		int t = str[i].size();
		len = max(len, t);
	}
	/* cout << len << endl; */

    for(int m = 0; m < len; m++)
	{
		string ss;
		for(int j = n; j >= 1; j--)   
		{
			if(str[j].size() > m)   ss.push_back(str[j][m]);
			else ss.push_back('*');
		}
		while(ss.back() == '*')  ss.pop_back();
		cout << ss << endl;
	}
}
signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr), cout.tie(nullptr);
	int t = 1;
	while (t--)
		solve();
	return 0;
}


